<?php

/*
 * author : wiloke
 * author uri: wiloke.com
 * date: 04/26/2014 
 * time: 07 AM
 */

$aOurServices = get_post_meta($post->ID, $post->post_type, true);

$aOurServices = isset($aOurServices['service']) ? $aOurServices['service'] : null;


$aOurServices = wp_parse_args($aOurServices, array('service_description'=>' ', 'service_title'=> array(''), 'service_icon'=> array('fa fa-refresh'), 'small_intro'=>array(' '), 'logo'=>' ', 'author'=> ' ', 'slogan'=>' ') );

?>

<div class="bt-reset">
    <div class="container-12-fluid">
        <div class="container-12-row">
            <?php
                foreach ($aOurServices['service_title'] as $k => $v) :
                ?>
                <div class="clone-me wrap-delete large-4">

                        <div class="panel">

                            <div class="panel-heading">
                                <div class="panel-title">
                                    <?php echo !empty($v) ? $v : 'Service'; ?>
                                </div>

                                <div class="panel-options">
                                       <a href="#" class="delele-this"><i class="fa fa-times"></i></a>
                                </div>
                            </div>

                            <div class="panel-body">

                                <div class="form-group">
                                    <label class="form-label">Icon</label>
                                    <div class="controls">
                                      <a class="available-panel thickbox" href="#TB_inline&width=600&height=600&inlineId=table-fa"><i class="is_icon <?php echo isset($aOurServices['service_icon'][$k]) ? $aOurServices['service_icon'][$k]: 'fa fa-refresh'; ?>"></i></a>
                                        <input type="hidden" class="service_icon is_icon" name="service[service_icon][]" value="<?php echo $aOurServices['service_icon'][$k] ?>"/>
                                       <p>Click on logo to change</p>
                                    </div>
                                </div>
                                 <div class="form-group">
                                    <label class="form-label">Title</label>
                                    <div class="controls">
                                      <input type="text" class="service_description widefat reset" placeholder="title" name="service[service_title][]"
                                      value="<?php echo $v ?>" >
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="form-label">Writting an introduction about our service</label>
                                    <div class="controls">
                                      <textarea type="text" class="service_description widefat reset" placeholder="title" name="service[small_intro][]"
                                     ><?php echo $aOurServices['small_intro'][$k] ?></textarea>
                                    </div>
                                </div>

                            </div>
                        </div>
                </div>
            <?php
            endforeach;
            ?>
            <div class="bo-add-new wo-wrapclone">
                <div class="">
                    <button class="btn btn-blue aboutus wo-addmore" type="button">Add More</button>
                </div>
            </div>
        </div>
    </div>
</div>








 